package com.chinasofti.project.common.pageQuery;

import com.chinasofti.project.common.ObjectBase;

/**
 * 
 * 用于分页查询时向service传参时使用,构造器会自动该计算limitStart,用于分页sql的编写
 * 
 * @author Lucas
 *
 * @Date 2018年9月27日 下午3:01:39
 *
 */
public class PageInfo extends ObjectBase {

	private long pageIdx;

	private long pageSize;

	private long limitStart;

	public PageInfo() {
	}

	public PageInfo(long pageIdx, long pageSize) {
		this.pageIdx = pageIdx;
		this.pageSize = pageSize;
		this.limitStart = (pageIdx - 1) * pageSize;
	}

	public long getPageIdx() {
		return pageIdx;
	}

	public void setPageIdx(long pageIdx) {
		this.pageIdx = pageIdx;
	}

	public long getPageSize() {
		return pageSize;
	}

	public void setPageSize(long pageSize) {
		this.pageSize = pageSize;
	}

	public long getLimitStart() {
		return limitStart;
	}
}
